<?php
/*
 * Plugin Name: Date Travel Date Widget
 * Version: 1.0
 * Plugin URI: http://code.google.com/p/widgetapps-wp-travelplugin/
 * Description: Allows the user to find posts by date.
 * Author: Darryl Patterson
 * Author URI: http://www.pattersons.net/
 */

class WidgetApps_Widget_Date extends WP_Widget {
	
	function WidgetApps_Widget_Date()
	{
		$widget_ops = array('classname' => 'WidgetApps_Widget_Date', 'description' => __( "Allows the user to find posts by date.") );
    	$control_ops = array('width' => 200, 'height' => 300);
    	parent::WP_Widget('WidgetApps_Widget_Date', __('Travel Date Search'), $widget_ops, $control_ops);
	}
	
	function widget($args, $instance)
	{
		// See http://codex.wordpress.org/Template_Tags/get_posts
		//get_posts('arguments');
?>
<h3>Departure Month</h3>
<form action="/watw/date" method="get">
	<dl>
		<dt>Year:</dt>
		<dd><select name="watw_year">
			<option value="2010">2010</option>
			<option value="2011">2011</option>
			<option value="2012">2012</option>
			<option value="2013">2013</option>
		</select></dd>
		<dt>Month:</dt>
		<dd><select name="watw_month">
			<option value="1">January</option>
			<option value="2">February</option>
			<option value="3">March</option>
			<option value="4">April</option>
			<option value="5">May</option>
			<option value="6">June</option>
			<option value="7">July</option>
			<option value="8">August</option>
			<option value="9">September</option>
			<option value="10">October</option>
			<option value="11">November</option>
			<option value="12">December</option>
		</select></dd>
	</dl>
	<br />
	<input type="submit" value="Search" />
</form>
<?php
	}
	
	function update($new_instance, $old_instance)
	{
		$instance = $old_instance;
 
		return $instance;
	}
	
	function form($instance)
	{
		echo '<p>Nothing to say here.</p>';
	}
	
	static function getSearchResults()
	{
		
	}
}
